<!DOCTYPE html>
<html lang="en" class="app">
<head>
    <meta charset="utf-8" />
    <title>登录 | CmsWing 管理后台</title>
    <meta name="description" content="app, web app, responsive, admin dashboard, admin, flat, flat ui, ui kit, off screen nav" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <link rel="stylesheet" href="/static/admin/js/jPlayer/jplayer.flat.css" type="text/css" />
    <link rel="stylesheet" href="/static/admin/css/bootstrap.css" type="text/css" />
    <link rel="stylesheet" href="/static/admin/css/animate.css" type="text/css" />
    <link rel="stylesheet" href="/static/admin/css/font-awesome.min.css" type="text/css" />
    <link rel="stylesheet" href="/static/admin/css/simple-line-icons.css" type="text/css" />
    <link rel="stylesheet" href="/static/admin/css/font.css" type="text/css" />
    <link rel="stylesheet" href="/static/admin/css/app.css" type="text/css" />
    <link rel="shortcut icon" type="image/x-icon" href="/static/favicon.ico" />
    <!--[if lt IE 9]>
    <script src="/static/admin/js/ie/html5shiv.js"></script>
    <script src="/static/admin/js/ie/respond.min.js"></script>
    <script src="/static/admin/js/ie/excanvas.js"></script>
    <![endif]-->
</head>
<body class="bg-info dker ">
<section id="content" class="m-t-lg wrapper-md animated fadeInUp ">
    <div class="container aside-xl">
        <a class="navbar-brand block" href="index.html"><span class="h1 font-bold">CmsWing</span></a>
        <section class="m-b-lg">
            <header class="wrapper text-center">
                <strong>管理员登陆</strong>
            </header>
            <form action="#" method="post" >
                <div class="form-group">
                    <input type="username" name="username" placeholder="用户名" class="form-control rounded input-lg text-center no-border">
                </div>
                <div class="form-group">
                    <input type="password" name="password" placeholder="密码" class="form-control rounded input-lg text-center no-border">
                </div>
                {%if controller.setup.GEETEST_IS_ADMLOGIN ==1%}
                <div class="form-group">
                    <div class="form-control rounded input-lg text-center no-border">
                    <div id="captcha"></div>
                    <p id="wait" class="show">正在加载验证码......</p>
                    </div>
                </div>
                <div class="alert alert-danger hide" id="notice">
                    <button type="button" class="close" data-dismiss="alert">×</button>
                    <i class="fa fa-ban-circle"></i>请先拖动验证码到相应位置.
                </div>
                {%endif%}
                <button type="submit" class="btn btn-lg btn-warning lt b-white b-2x btn-block btn-rounded" id="validate-submit">
                    <i class="icon-arrow-right pull-right"></i><span class="m-r-n-lg">登录</span></button>
                <div class="text-center m-t m-b"><a href="#"><small>忘记密码?</small></a></div>
                <!--<div class="line line-dashed"></div>-->
                <!--<p class="text-muted text-center"><small>Do not have an account?</small></p>-->
                <!--<a href="signup.html" class="btn btn-lg btn-info btn-block rounded">Create an account</a>-->
            </form>
        </section>
    </div>
</section>
<!-- footer -->
<footer id="footer">
    <div class="text-center padder">
        <p>
                <small>CmsWing网站内容管理框架<br>&copy; 2015</small>
        </p>
    </div>
</footer>
<!-- / footer -->
<script src="/static/admin/js/jquery.min.js"></script>
<!-- Bootstrap -->
<script src="/static/admin/js/bootstrap.js"></script>
<!-- App -->
<script src="/static/admin/js/app.js"></script>
<script src="/static/admin/js/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/static/admin/js/app.plugin.js"></script>
{%if controller.setup.GEETEST_IS_ADMLOGIN ==1%}
<!-- 引入封装了failback的接口--initGeetest -->
<script src="//static.geetest.com/static/tools/gt.js"></script>

<!-- 若是https，使用以下接口 -->
<!-- <script src="https://static.geetest.com/static/tools/gt.js"></script> -->
<script>
    $(function () {
        var handlerEmbed = function (captchaObj) {

            $("#validate-submit").click(function (e) {
                var validate = captchaObj.getValidate();
                if (!validate) {
                    $("#notice").addClass("show").removeClass("hide");
                    setTimeout(function () {
                        $("#notice").addClass("hide").removeClass("show");
                    }, 2000);
                    e.preventDefault();
                }

            });

            // 将验证码加到id为captcha的元素里
            captchaObj.appendTo("#captcha");

            captchaObj.onReady(function () {
                $("#wait")[0].className = "hide";
            });

            // 更多接口参考：http://www.geetest.com/install/sections/idx-client-sdk.html
        };

                $.ajax({
                    // 获取id，challenge，success（是否启用failback）
                    url: "/admin/public/geetest?t=" + (new Date()).getTime(), // 加随机数防止缓存
                    type: "get",
                    dataType: "json",
                    success: function (data) {

                        // 使用initGeetest接口
                        // 参数1：配置参数
                        // 参数2：回调，回调的第一个参数验证码对象，之后可以使用它做appendTo之类的事件
                        initGeetest({
                            gt: data.gt,
                            challenge: data.challenge,
                            product: "float", // 产品形式，包括：float，embed，popup。注意只对PC版验证码有效
                            offline: !data.success // 表示用户后台检测极验服务器是否宕机，一般不需要关注
                        }, handlerEmbed);
                    }
                });




    })
</script>
{%endif%}
</body>
</html>
